<?php

use yii\helpers\Url;
?>
<ul class="page-sidebar-menu  page-header-fixed " data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200" style="padding-top: 20px">
    <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
    <li class="sidebar-toggler-wrapper hide">
        <div class="sidebar-toggler">
            <span></span>
        </div>
    </li>
    
    <li class="nav-item <?= Yii::$app->controller->id == 'site' ? 'active' : '' ?> start">
        <a class="nav-link nav-toggle" href="/">
            <i class="icon-home"></i>
            <span class="title">首页</span>
            <span class="selected"></span>
        </a>
    </li>

    <?php foreach ($menus as $menu1): ?>
        <?php if ($menu1['children']): ?>
            <li class="nav-item <?= $menu1['class'] ?>">
                <a href="javascript:;" class="nav-link nav-toggle">
                    <i class="<?= $menu1['icon'] ?>"></i>
                    <span class="title"><?= $menu1['name'] ?></span>
                    <span class="selected"></span>
                    <span class="arrow <?= $menu1['class'] ?>"></span>
                </a>
                <ul class="sub-menu" style="display:<?= $menu1['class'] ? 'block' : 'none' ?>">
                    <?php foreach ($menu1['children'] as $menu2): ?>
                        <li class="nav-item <?= $menu2['class'] ?>">
                            <a href="<?= Url::to(array_merge(['/' . $menu2['route']], $menu2['params'])) ?>" class="nav-link">
                                <i class="<?= $menu2['icon'] ?>"></i>
                                <span class="title"><?= $menu2['name'] ?></span>
                                <span class="selected"></span>
                            </a>
                        </li>
                    <?php endforeach ?>
                </ul>
            </li>
        <?php endif ?>
    <?php endforeach ?>
</ul>
